Skip to content

feat(devex): add project templates, Python SDK demo, quickstart scrip… - #359

Merged
yash-pouranik merged 14 commits into
geturbackend:mainfrom
Nitin-kumar-yadav1307:devex-templates-and-examples
Jul 22, 2026
Merged

feat(devex): add project templates, Python SDK demo, quickstart scrip…#359
yash-pouranik merged 14 commits into
geturbackend:mainfrom
Nitin-kumar-yadav1307:devex-templates-and-examples

Conversation

@Nitin-kumar-yadav1307

@Nitin-kumar-yadav1307 Nitin-kumar-yadav1307 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR improves urBackend's Developer Experience (DevEx) by adding project templates, SDK demo projects, quickstart scaffolding scripts, and one-click Vercel deployment configurations.

What's Included

1. Project Templates Page (/templates)

  • New Templates page in the web dashboard with 6 ready-to-use project templates
  • Each template shows: SDK type, language, feature tags, description
  • Search by name/description/SDK
  • Filter by SDK (@urbackend/react, @urbackend/sdk, urbackend Python)
  • "Deploy to Vercel" buttons with pre-configured environment variables
  • "Copy Command" buttons for quickstart scripts
  • Expandable README - click any card to see setup instructions
  • Sidebar navigation link added under "General" section

Available Templates:

Template SDK Vercel Deploy
React SDK Demo @urbackend/react
Kanban Board @urbackend/sdk
Social Media (X Clone) @urbackend/sdk
Python SDK Demo urbackend (Python) -
TypeScript Quickstart @urbackend/sdk
Python Quickstart urbackend (Python) -

2. Python SDK Demo (examples/python-sdk-demo/)

  • Complete CLI application showcasing all Python SDK features:
    • Auth: Signup, login, token management, user profile
    • Database: Full CRUD (create, read, update, delete)
    • Storage: File upload and download URLs
    • Mail: Send transactional emails (server-side)
  • 6 unit tests using mocked SDK (no live API keys needed)
  • Clean output with emoji status indicators

3. Quickstart Scripts (examples/quickstart-scripts/)

  • setup-ts-sdk.sh - Interactive scaffold for TypeScript + @urbackend/sdk
  • setup-python-sdk.sh - Interactive scaffold for Python + urbackend
  • Both scripts: check prerequisites, prompt for API keys, create project structure, install deps

4. Vercel Deployment Config (examples/vercel.json)

  • Pre-configured deploy settings for all frontend examples
  • "Deploy to Vercel" buttons in templates page link to Vercel's import with pre-filled env vars

5. CI for Examples (.github/workflows/examples.yml)

  • Build validation for: react-sdk-demo, sdk-kanban (client), social-demo (client)
  • Test + lint for: python-sdk-demo
  • Triggers on changes to examples/ or sdks/ paths

6. DevEx Documentation (examples/DEVEX.md)

  • Comprehensive guide covering templates, quickstart scripts, SDK demos, deployment
  • "Adding a New Template" section with schema reference
  • File structure overview

Testing

# 1. Python SDK demo tests (mocked, no API keys)
cd examples/python-sdk-demo
pip install -r requirements.txt
python -m pytest tests/ -v          # 6/6 passing

# 2. Web dashboard (requires MongoDB running)
npm run dev --workspace=web-dashboard
# Navigate to http://localhost:5173/templates (or 5174 if 5173 busy)

# 3. Quickstart scripts (in temp directory)
bash examples/quickstart-scripts/setup-ts-sdk.sh
bash examples/quickstart-scripts/setup-python-sdk.sh

preview image

WhatsApp Image 2026-07-22 at 12 14 03 PM

Summary by CodeRabbit

  • New Features
    • Added a Templates page with SDK filtering, search, expandable README previews, and quickstart actions (deploy, view source, copy commands).
    • Added protected routing and a “Templates” item in the dashboard sidebar.
    • Added a Python SDK demo (auth, database, storage, and mail) plus a React SDK login flow update.
    • Added interactive TypeScript and Python SDK quickstart setup scripts.
  • Documentation
    • Added a DevEx guide for discovering and using project templates and quickstarts.
  • CI / Chores
    • Added Examples CI to run builds/tests for selected examples on pushes and PRs.
    • Updated Vercel example configuration documentation and added a Python demo environment example.
  • Tests
    • Added unit tests for Python demo functions.
  • Bug Fixes
    • Simplified React SDK authentication provider setup and improved post-login navigation.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Nitin-kumar-yadav1307, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 35385340-af12-4caf-bf13-9d8b07de1a4a

📥 Commits

Reviewing files that changed from the base of the PR and between 73d33fd and ad7cf9e.

⛔ Files ignored due to path filters (3)
  • examples/react-sdk-demo/package-lock.json is excluded by !**/package-lock.json
  • examples/sdk-kanban/client/package-lock.json is excluded by !**/package-lock.json
  • examples/social-demo/client/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • .github/workflows/examples.yml
  • examples/python-sdk-demo/main.py
  • examples/python-sdk-demo/tests/test_demo.py
  • examples/react-sdk-demo/package.json
  • examples/sdk-kanban/client/package.json
  • examples/social-demo/client/package.json
  • examples/vercel.json
📝 Walkthrough

Walkthrough

Adds a protected Templates dashboard page with navigation, filtering, README previews, deployment/source actions, and quickstart copying. Adds Python and TypeScript SDK demos, scaffolding scripts, documentation, Vercel metadata, React auth updates, and CI workflows.

Changes

Templates dashboard

Layer / File(s) Summary
Templates page behavior
apps/web-dashboard/src/pages/Templates.jsx
Adds template metadata, SDK/search filtering, expandable README previews, deployment/source links, and clipboard quickstart commands.
Templates dashboard wiring
apps/web-dashboard/src/App.jsx, apps/web-dashboard/src/components/Layout/Sidebar.jsx
Registers the protected /templates route and adds Templates to sidebar navigation.

Python SDK example

Layer / File(s) Summary
Python SDK demo and validation
examples/python-sdk-demo/*
Adds configuration, dependencies, documentation, authentication, database CRUD, storage, mail flows, and mocked pytest coverage.

SDK scaffolding and delivery

Layer / File(s) Summary
SDK quickstart scaffolding
examples/quickstart-scripts/*
Adds interactive Python and TypeScript project generators with prerequisite checks, generated code, tests, dependency installation, and usage instructions.
Example delivery and CI
examples/DEVEX.md, examples/vercel.json, examples/react-sdk-demo/src/App.tsx, .github/workflows/examples.yml
Documents templates and examples, updates Vercel metadata and React authentication usage, and adds Node build and Python test jobs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested labels: feature, type:feature, intermediete-advance

Suggested reviewers: yash-pouranik

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: templates, the Python SDK demo, and quickstart scripts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (5)
apps/web-dashboard/src/pages/Templates.jsx (1)

120-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Quickstart command strings are duplicated across six locations.

The TypeScript and Python curl commands are hardcoded independently in the readme fields (120, 141), inside copyQuickstart (168-169), and again as literal strings in the Quickstart section (363-364, 376-377). Any change to the script path or hosting URL requires updating all of them in sync.

const QUICKSTART_COMMANDS = {
  TypeScript: 'bash <(curl -fsSL https://raw.githubusercontent.com/geturbackend/urBackend/main/examples/quickstart-scripts/setup-ts-sdk.sh)',
  Python: 'bash <(curl -fsSL https://raw.githubusercontent.com/geturbackend/urBackend/main/examples/quickstart-scripts/setup-python-sdk.sh)',
};

Reference QUICKSTART_COMMANDS.Python / .TypeScript from copyQuickstart, the two inline buttons, and interpolate into the readme templates.

Also applies to: 141-141, 166-169, 363-364, 376-377

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web-dashboard/src/pages/Templates.jsx` at line 120, Define a shared
QUICKSTART_COMMANDS constant for the TypeScript and Python setup commands, then
replace every duplicated literal in the readme templates, copyQuickstart, and
inline Quickstart buttons with the corresponding QUICKSTART_COMMANDS.TypeScript
or QUICKSTART_COMMANDS.Python reference. Keep the generated command text
unchanged.
examples/DEVEX.md (1)

151-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Specify the language for the file-tree fence.

markdownlint reports MD040 here; use ```text for this non-language source block.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/DEVEX.md` around lines 151 - 172, Update the file-tree code fence in
DEVEX.md to declare the text language, changing the opening fence to ```text
while preserving the directory tree content unchanged.

Source: Linters/SAST tools

examples/vercel.json (1)

5-7: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Do not install dependencies twice.

Vercel already runs installCommand before buildCommand; remove npm install from each build command and leave only the project build. (vercel.com)

Proposed fix
- "buildCommand": "cd examples/react-sdk-demo && npm install && npm run build",
+ "buildCommand": "cd examples/react-sdk-demo && npm run build",

Apply the same change to the Kanban and social demo entries.

Also applies to: 11-13, 17-19

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/vercel.json` around lines 5 - 7, Remove the redundant npm install
step from the buildCommand entries in the Vercel configuration, including the
React SDK, Kanban, and social demo entries. Keep each command’s directory change
and npm run build invocation unchanged, while leaving the separate
installCommand entries intact.

Source: MCP tools

.github/workflows/examples.yml (2)

71-74: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the Python CI environment reproducible.

requirements.txt uses open-ended lower bounds such as urbackend>=0.1.0 and pytest>=7.0.0, so future releases can change or break this job unexpectedly. Use a lock/constraints file or bounded versions refreshed intentionally.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/examples.yml around lines 71 - 74, Update the Python CI
steps in the workflow around the requirements installation and pytest command to
use a committed lock or constraints file with bounded, intentionally refreshed
dependency versions. Ensure both installation and test execution use the
reproducible dependency set while preserving the existing test command.

3-13: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Include the workflow file in its own path filters.

A change limited to .github/workflows/examples.yml will not run this workflow because only examples/** and sdks/** are listed. Add the workflow path to both push.paths and pull_request.paths. (docs.github.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/examples.yml around lines 3 - 13, Update the workflow path
filters in examples.yml by adding .github/workflows/examples.yml to both
push.paths and pull_request.paths, preserving the existing examples/** and
sdks/** entries.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/examples.yml:
- Around line 1-3: Update the Examples CI workflow to grant only read access to
repository contents and disable persisted credentials on every actions/checkout
step. Include .github/workflows/examples.yml in the relevant paths filters so
workflow changes trigger CI, and replace lower-bound Python dependency
requirements with exact pinned versions for reproducibility.

In `@apps/web-dashboard/src/pages/Templates.jsx`:
- Around line 166-172: Handle the Promise returned by
navigator.clipboard.writeText in copyQuickstart and both inline Quickstart Copy
button handlers: show the success toast only after the write resolves, show
appropriate failure feedback when it rejects or is unavailable, and add
equivalent success/failure handling to the inline buttons while preserving their
existing commands.
- Around line 220-231: The template card’s expand/collapse control is mouse-only
because the clickable div lacks keyboard semantics. Update the card div around
the expandedId onClick to expose an appropriate interactive role, make it
keyboard focusable, and handle Enter and Space key presses by toggling
expandedId while preserving the existing click behavior.

In `@examples/DEVEX.md`:
- Around line 41-49: Update the TypeScript and Python quickstart commands in the
DEVEX documentation to reference an approved immutable commit or release tag
instead of the mutable main branch; preferably add checksum verification before
executing the downloaded scripts.

In `@examples/python-sdk-demo/main.py`:
- Around line 12-13: Update the type annotation in the demo’s Python entry point
to use Optional[dict] instead of dict | None, and add or reuse the appropriate
Optional import so the file remains compatible with Python 3.9.
- Around line 168-187: Update the storage demo cleanup around the upload result
and finally block: retain the uploaded object path from result["path"], then
call client.storage.delete_file with that path during cleanup. Guard deletion
when no upload succeeded, while preserving the existing local test-file removal.

In `@examples/python-sdk-demo/tests/test_demo.py`:
- Around line 14-28: Remove the module-level sys.modules["urbackend"] override
from the test setup, since these tests do not require it; if mocking the import
remains necessary, apply the override through pytest’s monkeypatch fixture so it
is automatically restored after each test.

In `@examples/quickstart-scripts/setup-python-sdk.sh`:
- Around line 60-62: Remove the unused SECRET_KEY and PROJECT_ID prompts and
generated .env entries from examples/quickstart-scripts/setup-python-sdk.sh and
examples/quickstart-scripts/setup-ts-sdk.sh at lines 60-62, leaving only
publishable credentials in these client scaffolds.
- Around line 39-43: Update the Python version validation in the setup script to
parse and compare both major and minor versions, rejecting Python versions below
3.9 while preserving acceptance of Python 3.9 and newer and the existing
error/exit behavior.
- Line 127: Update the UrBackendClient construction in the generated Python SDK
setup to pass API_URL through the supported base parameter instead of base_url,
ensuring main.py constructs the client without a TypeError.

In `@examples/quickstart-scripts/setup-ts-sdk.sh`:
- Around line 39-43: Update the Node.js version check in setup-ts-sdk.sh to
require Node 20 or newer, matching the global File constructor used by the
storage demo's new File(...) calls. Keep the existing version parsing and
unsupported-version exit behavior unchanged.
- Around line 89-97: Add dotenv to the generated package.json dependencies
alongside `@urbackend/sdk` in the setup script, ensuring the generated
src/index.ts import resolves after npm install and the build succeeds.

In `@examples/vercel.json`:
- Around line 2-3: Replace the unsupported top-level deploy object in
vercel.json with supported per-application Vercel configuration, or move each
demo’s project and root-directory settings into its Deploy Button URL
parameters. Ensure all three demos remain independently configurable and
deployable.

---

Nitpick comments:
In @.github/workflows/examples.yml:
- Around line 71-74: Update the Python CI steps in the workflow around the
requirements installation and pytest command to use a committed lock or
constraints file with bounded, intentionally refreshed dependency versions.
Ensure both installation and test execution use the reproducible dependency set
while preserving the existing test command.
- Around line 3-13: Update the workflow path filters in examples.yml by adding
.github/workflows/examples.yml to both push.paths and pull_request.paths,
preserving the existing examples/** and sdks/** entries.

In `@apps/web-dashboard/src/pages/Templates.jsx`:
- Line 120: Define a shared QUICKSTART_COMMANDS constant for the TypeScript and
Python setup commands, then replace every duplicated literal in the readme
templates, copyQuickstart, and inline Quickstart buttons with the corresponding
QUICKSTART_COMMANDS.TypeScript or QUICKSTART_COMMANDS.Python reference. Keep the
generated command text unchanged.

In `@examples/DEVEX.md`:
- Around line 151-172: Update the file-tree code fence in DEVEX.md to declare
the text language, changing the opening fence to ```text while preserving the
directory tree content unchanged.

In `@examples/vercel.json`:
- Around line 5-7: Remove the redundant npm install step from the buildCommand
entries in the Vercel configuration, including the React SDK, Kanban, and social
demo entries. Keep each command’s directory change and npm run build invocation
unchanged, while leaving the separate installCommand entries intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8127816c-d15f-4708-a7c9-3a753bf1125d

📥 Commits

Reviewing files that changed from the base of the PR and between ba6fb3d and 8f3bf73.

📒 Files selected for processing (14)
  • .github/workflows/examples.yml
  • apps/web-dashboard/src/App.jsx
  • apps/web-dashboard/src/components/Layout/Sidebar.jsx
  • apps/web-dashboard/src/pages/Templates.jsx
  • examples/DEVEX.md
  • examples/python-sdk-demo/.env.example
  • examples/python-sdk-demo/README.md
  • examples/python-sdk-demo/main.py
  • examples/python-sdk-demo/requirements.txt
  • examples/python-sdk-demo/tests/__init__.py
  • examples/python-sdk-demo/tests/test_demo.py
  • examples/quickstart-scripts/setup-python-sdk.sh
  • examples/quickstart-scripts/setup-ts-sdk.sh
  • examples/vercel.json

Comment thread .github/workflows/examples.yml
Comment thread apps/web-dashboard/src/pages/Templates.jsx
Comment thread apps/web-dashboard/src/pages/Templates.jsx
Comment thread examples/DEVEX.md
Comment thread examples/python-sdk-demo/main.py
Comment thread examples/quickstart-scripts/setup-python-sdk.sh
Comment thread examples/quickstart-scripts/setup-python-sdk.sh Outdated
Comment thread examples/quickstart-scripts/setup-python-sdk.sh Outdated
Comment thread examples/quickstart-scripts/setup-ts-sdk.sh
Comment thread examples/vercel.json Outdated
…ts, and Vercel deploy config

- Add Templates page (/templates) to web dashboard with 6 project templates
  (React SDK Demo, Kanban Board, Social Media Clone, Python SDK Demo,
  TypeScript Quickstart, Python Quickstart)
- Add sidebar navigation link for Templates
- Create Python SDK demo project with full auth, CRUD, storage, mail demos
  and unit tests (6/6 passing with mocks)
- Add interactive quickstart scripts for TypeScript and Python SDK scaffolding
- Configure Vercel deployment for all frontend examples
- Add CI workflow for example projects
- Add comprehensive DevEx documentation (examples/DEVEX.md)
@Nitin-kumar-yadav1307
Nitin-kumar-yadav1307 force-pushed the devex-templates-and-examples branch from 8f3bf73 to 7f96d1b Compare July 22, 2026 07:06
1. CI: add permissions: contents: read, persist-credentials: false,
   include workflow in paths, pin Python deps
2. DEVEX.md: use immutable release tag + checksum verification for
   quickstart scripts
3. main.py: use Optional[dict] instead of dict | None for Python 3.9 compat
4. Quickstart scripts: remove SECRET_KEY/PROJECT_ID from client scaffolds,
   keep only publishable credentials
5. Python quickstart: fix base_url -> base parameter for UrBackendClient
1. setup-ts-sdk.sh: require Node.js 20+ (needed for global File constructor)
2. vercel.json: replace unsupported top-level deploy object with per-app config
   reference, each demo keeps its own vercel.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
.github/workflows/examples.yml (1)

84-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider installing from requirements.txt instead of duplicating pins.

urbackend==0.1.1 python-dotenv==1.2.2 pytest==9.1.1 duplicates whatever examples/python-sdk-demo/requirements.txt declares. If the two drift, CI could pass/fail inconsistently with local pip install -r requirements.txt runs.

       - run: |
           python -m pip install --upgrade pip
-          pip install urbackend==0.1.1 python-dotenv==1.2.2 pytest==9.1.1
+          pip install -r requirements.txt
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/examples.yml around lines 84 - 86, Update the dependency
installation step in the workflow to install from
examples/python-sdk-demo/requirements.txt instead of duplicating the urbackend,
python-dotenv, and pytest pins, while preserving the existing pip upgrade
command.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/examples.yml:
- Around line 84-88: Remove the stray </write_to_file></tool_call> artifact from
.github/workflows/examples.yml at lines 84-88 after the pytest step, and from
examples/vercel.json at lines 1-5 after the closing JSON object; make no other
changes so both files remain valid YAML and JSON.

In `@apps/web-dashboard/src/pages/Templates.jsx`:
- Line 115: Fix the invalid Vercel deploy links by removing them or updating
them to actual deployable project paths: update the deployUrl entry in
Templates.jsx, and the corresponding link in setup-python-sdk.sh. Ensure neither
link references the nonexistent examples/quickstart-ts or
examples/quickstart-python directories.

In `@examples/DEVEX.md`:
- Around line 43-54: Replace the placeholder a1b2c3d4e5f6 values in both
TypeScript and Python quickstart commands with the actual SHA-256 digests of
their pinned setup-ts-sdk.sh and setup-python-sdk.sh release artifacts, and
update the verification commands to use sha256sum while preserving checksum
validation before execution.

In `@examples/quickstart-scripts/setup-ts-sdk.sh`:
- Around line 87-96: Remove the backticks surrounding the `@urbackend/sdk` and
`@types/node` dependency keys in the package.json heredoc within setup-ts-sdk.sh,
or otherwise quote the heredoc delimiter to prevent command substitution.
Preserve the generated package.json dependency names exactly so installation and
the generated src/index.ts import work correctly.
- Around line 13-16: Update the prerequisites comment in setup-ts-sdk.sh to
state Node.js 20+ so it matches the version enforced by the script and required
by its later File usage.
- Around line 156-161: Remove the invalid client.setToken(token) call from the
login flow after client.auth.login; rely on login’s existing session storage, or
use the valid client.auth.setToken API only if manual token assignment is
required.

---

Nitpick comments:
In @.github/workflows/examples.yml:
- Around line 84-86: Update the dependency installation step in the workflow to
install from examples/python-sdk-demo/requirements.txt instead of duplicating
the urbackend, python-dotenv, and pytest pins, while preserving the existing pip
upgrade command.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 776d8753-aa78-4673-86da-13dc1acca8d5

📥 Commits

Reviewing files that changed from the base of the PR and between 8f3bf73 and 6ea0e56.

📒 Files selected for processing (15)
  • .github/workflows/examples.yml
  • apps/web-dashboard/src/App.jsx
  • apps/web-dashboard/src/components/Layout/Sidebar.jsx
  • apps/web-dashboard/src/pages/Templates.jsx
  • examples/DEVEX.md
  • examples/python-sdk-demo/.env.example
  • examples/python-sdk-demo/README.md
  • examples/python-sdk-demo/main.py
  • examples/python-sdk-demo/requirements.txt
  • examples/python-sdk-demo/tests/__init__.py
  • examples/python-sdk-demo/tests/test_demo.py
  • examples/quickstart-scripts/setup-python-sdk.sh
  • examples/quickstart-scripts/setup-ts-sdk.sh
  • examples/react-sdk-demo/src/App.tsx
  • examples/vercel.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • examples/python-sdk-demo/README.md
  • examples/python-sdk-demo/requirements.txt
  • apps/web-dashboard/src/App.jsx
  • apps/web-dashboard/src/components/Layout/Sidebar.jsx
  • examples/python-sdk-demo/tests/test_demo.py

Comment thread .github/workflows/examples.yml Outdated
Comment thread apps/web-dashboard/src/pages/Templates.jsx Outdated
Comment thread examples/DEVEX.md Outdated
Comment thread examples/quickstart-scripts/setup-ts-sdk.sh
Comment thread examples/quickstart-scripts/setup-ts-sdk.sh Outdated
Comment thread examples/quickstart-scripts/setup-ts-sdk.sh Outdated
…ses, storage cleanup, test mocks

1. setup-ts-sdk.sh: require Node.js 20+ for global File constructor
2. Templates.jsx: fix invalid deployUrl for quickstart-ts, add Promise
   handling to copy buttons, card keyboard support already present
3. examples.yml: remove stray </write_to_file> artifact
4. DEVEX.md: replace placeholder checksums with actual SHA-256 digests
5. main.py: add remote file cleanup after storage upload
6. test_demo.py: remove module-level sys.modules override, use setup_method

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/python-sdk-demo/main.py`:
- Line 167: Initialize uploaded_path immediately after test_file_path and before
the first fallible file-creation or write operation, while preserving the
existing finally cleanup logic that uses uploaded_path.

In `@examples/python-sdk-demo/tests/test_demo.py`:
- Line 120: Remove the stray non-Python token immediately after the final
assertion in test_demo.py so the module parses successfully and pytest can
collect it; leave the assertion and surrounding test logic unchanged.
- Around line 38-77: Update the auth demo and its tests to use the AuthModule
API method sign_up instead of signup. Replace the signup references in demo_auth
and the related mock setup, side effects, and assertions in test_demo.py while
preserving the existing success, fallback, and failure behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 33aa168e-66a3-4a35-b63d-948e8de671a6

📥 Commits

Reviewing files that changed from the base of the PR and between 6ea0e56 and 73d33fd.

📒 Files selected for processing (6)
  • .github/workflows/examples.yml
  • apps/web-dashboard/src/pages/Templates.jsx
  • examples/DEVEX.md
  • examples/python-sdk-demo/main.py
  • examples/python-sdk-demo/tests/test_demo.py
  • examples/quickstart-scripts/setup-ts-sdk.sh
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/examples.yml
  • apps/web-dashboard/src/pages/Templates.jsx
  • examples/quickstart-scripts/setup-ts-sdk.sh
  • examples/DEVEX.md

Comment thread examples/python-sdk-demo/main.py Outdated
Comment thread examples/python-sdk-demo/tests/test_demo.py Outdated
Comment thread examples/python-sdk-demo/tests/test_demo.py Outdated
- @urbackend/sdk@0.4.5 has broken exports, 0.4.2 works correctly
- urbackend Python package only has 0.1.0 on PyPI, not 0.1.1
- Python SDK uses sign_up method name, not signup
- Updated all mock setups, side effects, and assertions
- Removed stray XML token from test_demo.py
- react-sdk-demo package-lock uses file: references to local SDKs
- Add build steps for sdks/urbackend-sdk and sdks/urbackend-react
- Pin @urbackend/sdk to 0.4.2 in all examples
- Pin @urbackend/react to 0.1.0 in react-sdk-demo
- Remove local file: references that require building SDKs first
- Update CI to build from root with workspace flags
- npm workspaces must be defined in root package.json
- examples are not in the workspaces array
- Use defaults.run.working-directory instead
@yash-pouranik

Copy link
Copy Markdown
Member

How user is able to use the templates from the UI? @coderabbitai

@yash-pouranik yash-pouranik self-assigned this Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
printf '\n--- action and template references ---\n'
rg -n -C 3 'deployUrl|repoUrl|copyCommand|Copy Command|Deploy to Vercel|README|Quickstart from Terminal|handleCopy' apps/web-dashboard/src/pages/Templates.jsx

Length of output: 5491


The Comment image shows the dark Templates dashboard: users can search with “Search templates…”, filter by All SDKs, @urbackend/react, @urbackend/sdk, or urbackend (Python), then choose from six cards. The cards show feature tags and expose Deploy to Vercel, View Source, or Copy Command actions.

@yash-pouranik Users consume a template through one of these flows:

  1. Discover and inspect

    • Navigate to /templates from the sidebar.
    • Search or filter by SDK.
    • Click a template card to expand its README/instructions in the dashboard.
  2. Deploy supported web templates

    • Click Deploy to Vercel for React SDK Demo, Kanban Board, Social Media, or TypeScript Quickstart.
    • This opens Vercel’s clone/deploy flow for that example repository and prompts for the template’s required environment variable(s).
  3. Use the source directly

    • Click View Source to open the corresponding GitHub example directory.
    • The user can clone it, configure environment variables, install dependencies, and run it locally.
  4. Scaffold a new project

    • For TypeScript Quickstart and Python Quickstart, click Copy Command and run the copied terminal command.
    • The script interactively creates a new project and asks for the required urBackend credentials.

The Python SDK Demo is source-based only at the moment—there is no Vercel deploy action configured for it.

@yash-pouranik

Copy link
Copy Markdown
Member

everything LGTM
and u said this- "The user can clone it, configure environment variables, install dependencies, and run it locally."

@coderabbitai

Those examples are in monorepo, So there should me commands attached to clone that particular project folder only?

Else LGTM what say?

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
printf '\n--- template action definitions ---\n'
rg -n -C 4 'repoUrl|deployUrl|copyCommand|View Source|Copy Command|Quickstart from Terminal' \
  apps/web-dashboard/src/pages/Templates.jsx

printf '\n--- workspace and example manifests ---\n'
for file in package.json; do
  if [ -f "$file" ]; then
    printf '\n### %s\n' "$file"
    sed -n '1,220p' "$file"
  fi
done
fd -a -HI '^package\.json$|^requirements\.txt$|^README\.md$' examples -x sh -c '
  printf "\n### %s\n" "$1"
  sed -n "1,100p" "$1"
' sh {} \;

Length of output: 23871


The Comment image shows the /templates gallery with source/deploy actions but no per-template checkout command. The visible cards support the concern: users can view an example directory, but the UI does not yet tell them how to obtain and run just that example from the monorepo.

@​yash-pouranik, the shell results confirm your point—and uncover a couple of concrete docs issues:

  • Yes, add a template-specific “Copy setup command” / “Get template” action for source-based templates. View Source alone is not a complete local-consumption flow.
  • The Python demo README currently says:
    git clone https://github.com/geturbackend/urBackend.git
    cd examples/python-sdk-demo
    That cd is wrong after cloning; it must include the cloned repository directory, e.g. cd urBackend/examples/python-sdk-demo.
  • The Social demo has the same missing repository-directory issue and points to yash-pouranik/urBackend, while the dashboard links use geturbackend/urBackend.
  • Kanban is the exception: its server depends on file:../../../sdks/urbackend-sdk, so sparse-checking out only examples/sdk-kanban will fail unless the command also checks out sdks/urbackend-sdk, or the example is changed to consume a published SDK version.

For standalone examples, a generated command can use sparse checkout:

git clone --depth 1 --filter=blob:none --sparse https://github.com/geturbackend/urBackend.git urbackend-react-demo
cd urbackend-react-demo
git sparse-checkout set examples/react-sdk-demo
cd examples/react-sdk-demo
npm install && npm run dev

For Kanban, either include both directories:

git sparse-checkout set examples/sdk-kanban sdks/urbackend-sdk

—or, preferably for a user-facing template, replace the local file: dependency with the published SDK version.

So I would revise my earlier LGTM: the template gallery itself is good, but the local-use docs/actions need these fixes for the advertised “View Source → run locally” workflow to be reliable.

@yash-pouranik

yash-pouranik commented Jul 22, 2026

Copy link
Copy Markdown
Member

So list what needs to be updated.
And as If this PR looks good u can create a issue and then nitin can work on that in next PR?

@coderabbitai

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Templates action definitions ---'
ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
rg -n -C 4 'repoUrl|deployUrl|copyCommand|View Source|Copy Command|Quickstart from Terminal' \
  apps/web-dashboard/src/pages/Templates.jsx

printf '%s\n' '--- Example setup documentation and repository references ---'
fd -a -HI '^(README\.md|DEVEX\.md|package\.json|requirements\.txt)$' examples -x sh -c '
  file="$1"
  matches=$(rg -n -i -C 3 "git clone|sparse-checkout|github\.com/.*/urBackend|npm (install|run)|pip install|cd examples" "$file" || true)
  if [ -n "$matches" ]; then
    printf "\n### %s\n%s\n" "$file" "$matches"
  fi
' sh {}

printf '%s\n' '--- Local workspace dependencies used by example manifests ---'
rg -n -C 3 '"file:|workspace:' examples -g 'package.json'

printf '%s\n' '--- Existing related GitHub issues ---'
gh issue list --repo geturbackend/urBackend --state open --limit 100 \
  --search 'template OR templates OR sparse checkout OR quickstart' \
  --json number,title,url,body \
  --jq '.[] | {number, title, url, body}'

Length of output: 9589


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="geturbackend/urBackend"
pr_number="359"

comment_url=$(
  gh api "repos/${repo}/issues/${pr_number}/comments" \
    --paginate \
    --jq '.[] | select(.user.login == "yash-pouranik" and (.body | contains("So list what needs to be updated."))) | .html_url' \
  | tail -n 1
)

if [ -z "${comment_url}" ]; then
  echo "Could not find the originating PR comment permalink." >&2
  exit 1
fi

issue_body=$(cat <<EOF
## Summary

Make the source-based template workflow in the \`/templates\` dashboard reliable for a monorepo. The current **View Source** action is useful for discovery, but the README/setup flow does not consistently let a user fetch and run the selected example.

## Required changes

- Add a template-specific local setup flow (for example, a **Copy setup command** action and/or matching expanded README instructions) for the React SDK Demo, Social Media demo, Python SDK Demo, and Kanban Board.
  - Standalone examples may use a sparse checkout command.
  - Instructions must include the actual cloned repository directory before changing into the example directory.
- Correct \`examples/python-sdk-demo/README.md\`:
  - After cloning \`https://github.com/geturbackend/urBackend.git\`, change into the cloned repository directory before \`examples/python-sdk-demo\`.
- Correct \`examples/social-demo/README.md\`:
  - Use the canonical \`https://github.com/geturbackend/urBackend.git\` repository URL.
  - Correct the \`cd\` path to include the cloned repository directory.
  - Update the documentation link to the canonical repository.
- Resolve/document Kanban’s non-standalone dependency:
  - \`examples/sdk-kanban/server/package.json\` declares \`@urbackend/sdk\` as \`file:../../../sdks/urbackend-sdk\`.
  - Either make the setup command sparse-check out both \`examples/sdk-kanban\` and \`sdks/urbackend-sdk\`, or replace the local file dependency with an appropriate published SDK version.
- Keep the dashboard metadata in \`apps/web-dashboard/src/pages/Templates.jsx\`, the expanded README content, and each example README consistent.

## Affected areas

- \`apps/web-dashboard/src/pages/Templates.jsx\`
- \`examples/python-sdk-demo/README.md\`
- \`examples/social-demo/README.md\`
- \`examples/sdk-kanban/README.md\`
- \`examples/sdk-kanban/server/package.json\`

## Acceptance criteria

- A user can follow the UI-provided or README-provided instructions to obtain and start each advertised source-based template without guessing paths.
- All clone and documentation links use \`geturbackend/urBackend\`.
- Python and Social setup commands work from a clean shell after cloning.
- Kanban setup succeeds with its SDK dependency available, or no longer relies on a repository-local SDK path.
- The template cards and their linked documentation describe the same supported workflow.

## Backlinks

- PR: https://github.com/geturbackend/urBackend/pull/359
- Originating review discussion: ${comment_url}
- Requested by: `@yash-pouranik`
EOF
)

issue_url=$(gh issue create \
  --repo "$repo" \
  --title "Provide reliable local setup flows for monorepo templates" \
  --body "$issue_body" \
  --assignee "yash-pouranik")

printf 'Created follow-up issue: %s\n' "$issue_url"

Length of output: 3444


The Comment image shows the /templates dashboard with searchable/filterable cards and the existing Deploy to Vercel, View Source, and quickstart Copy Command actions. It supports the follow-up scope: source-based examples need a clearer local setup path, while the gallery itself is complete.

@yash-pouranik, created follow-up issue #360: Provide reliable local setup flows for monorepo templates.

It covers:

  • per-template local setup/copy commands;
  • Python and Social README clone-path fixes;
  • canonical geturbackend/urBackend links;
  • Kanban’s local SDK dependency; and
  • consistency between dashboard metadata and README guidance.

I assigned it to you because Nitin’s GitHub username was not provided; you can reassign it to him. These are non-blocking DevEx follow-ups, so this PR looks good from this concern.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- template actions ---'
ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
rg -n -C 3 'repoUrl|deployUrl|copyCommand|View Source|Copy Command' \
  apps/web-dashboard/src/pages/Templates.jsx

printf '%s\n' '--- relevant documentation and package dependency references ---'
for file in \
  examples/python-sdk-demo/README.md \
  examples/social-demo/README.md \
  examples/sdk-kanban/server/package.json \
  examples/sdk-kanban/client/package.json
do
  if [ -f "$file" ]; then
    printf '\n### %s\n' "$file"
    rg -n -C 2 'git clone|^cd |file:|urBackend|urbackend' "$file" || true
  fi
done

printf '%s\n' '--- PR discussion comment permalinks ---'
gh api repos/geturbackend/urBackend/issues/359/comments \
  --paginate \
  --jq '.[] | select(.body | contains("So list what needs to be updated.")) | {url: .html_url, user: .user.login}'

Length of output: 12311


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="geturbackend/urBackend"
pr_url="https://github.com/geturbackend/urBackend/pull/359"
comment_url="https://github.com/geturbackend/urBackend/pull/359#issuecomment-5045751311"

body=$(cat <<EOF
## Summary

Make every source-based project template consumable locally from the monorepo without requiring users to infer checkout paths or dependency prerequisites.

This is a follow-up to the Templates gallery introduced in ${pr_url} and the discussion in ${comment_url}, requested by `@yash-pouranik`.

## Required changes

- Add a template-specific local setup flow to the dashboard (for example, a **Copy setup command** action or expanded README instructions) for templates that expose **View Source**.
  - Commands should either clone the repository and use the correct repository-root-relative path, or use sparse checkout where the example is standalone.
  - Preserve the existing quickstart scaffold commands for the TypeScript and Python quickstarts.
- Correct the Python demo setup instructions in \`examples/python-sdk-demo/README.md\`:
  - After \`git clone ... urBackend.git\`, use \`cd urBackend/examples/python-sdk-demo\` (or an equivalent clone-directory-aware command).
- Correct the Social demo instructions in \`examples/social-demo/README.md\`:
  - Replace the stale \`yash-pouranik/urBackend\` clone and documentation URLs with \`geturbackend/urBackend\`.
  - Use \`cd urBackend/examples/social-demo\` (or an equivalent clone-directory-aware command).
- Define a viable local-consumption strategy for Kanban:
  - \`examples/sdk-kanban/server/package.json\` currently depends on \`@urbackend/sdk\` via \`file:../../../sdks/urbackend-sdk\`.
  - Either have its setup command sparse-check out both \`examples/sdk-kanban\` and \`sdks/urbackend-sdk\`, or migrate the server to the published SDK package version and document the supported workflow.
- Validate all dashboard-provided commands and README quickstarts from a clean checkout.

## Affected areas

- \`apps/web-dashboard/src/pages/Templates.jsx\`
- \`examples/python-sdk-demo/README.md\`
- \`examples/social-demo/README.md\`
- \`examples/sdk-kanban/server/package.json\`
- Any related template documentation / DevEx guidance.

## Acceptance criteria

- Each template card provides or links to an explicit, working local setup path.
- A user following each documented command reaches the intended example directory without manual path correction.
- All public repository links consistently target \`geturbackend/urBackend\`.
- Kanban installation works under its documented checkout strategy.
- Existing Vercel deployment and quickstart-scaffold flows remain functional.
EOF
)

gh issue create \
  --repo "$repo" \
  --title "Follow up: make monorepo templates directly consumable locally" \
  --body "$body" \
  --assignee "yash-pouranik"

Length of output: 3034


The Comment image shows the Templates UI’s current split: quickstarts have Copy Command, while source templates only have View Source, which is the follow-up being tracked.

@yash-pouranik, created follow-up issue #361: #361

It covers:

  1. Add clear, template-specific local setup commands/instructions for source-based templates.
  2. Fix Python demo’s post-clone path to include the repository directory.
  3. Fix Social demo’s post-clone path and stale yash-pouranik/urBackend links.
  4. Resolve/document Kanban’s file:../../../sdks/urbackend-sdk dependency so its checkout/install flow works.
  5. Validate each documented/dashboard-provided local flow from a clean checkout.

I assigned it to you because no GitHub username for Nitin was supplied; you can reassign #361 to him.

The current PR looks good to merge with this tracked as a follow-up.

@yash-pouranik
yash-pouranik merged commit a251cf3 into geturbackend:main Jul 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants